//
//  Macros.h
//  AudioVideo
//
//  Created by xueshan1 on 2019/8/22.
//  Copyright © 2019 xueshan1. All rights reserved.
//

#ifndef Macros_h
#define Macros_h


//app名字
#define kZL_LOCALIZED_APP_NAME [[NSBundle mainBundle].localizedInfoDictionary objectForKey:@"CFBundleDisplayName"]
#define kAPPName kZL_LOCALIZED_APP_NAME ?: [[NSBundle mainBundle].infoDictionary objectForKey:@"CFBundleDisplayName"] ?: [[NSBundle mainBundle].infoDictionary objectForKey:@"CFBundleName"]

#define IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
#define IS_IPHONE_X ((IS_IPHONE && ((kWidth == 414 && kHeight == 896.0)||(kWidth == 375 && kHeight == 812)))? YES : NO)

#define WeakSelf __weak __typeof(&*self)weakSelf = self;

#define NSLog(format, ...) printf("\n[%s] %s [第%d行] %s\n", __TIME__, __FUNCTION__, __LINE__, [[NSString stringWithFormat:format, ## __VA_ARGS__] UTF8String]);

//判断字符串 字典 数组类型的方法
#define IS_NSDictionary(x) ([x isKindOfClass:[NSDictionary class]])
#define IS_NSArray(x) ([x isKindOfClass:[NSArray class]] && [x count]>0)
#define IS_NSString(x) ([x isKindOfClass:[NSString class]] && x.length>0)
#define IS_NSStringEx(x) (!(x==nil || [x isKindOfClass:[NSNull class]]) && [x isKindOfClass:[NSString class]] && x.length>0 && ![x isEqualToString:@"(null)"] && ![x isEqualToString:@"<null>"])
#define IS_NSMutableDictionary(x) ([x isKindOfClass:[NSMutableDictionary class]])
#define IS_NSMutableArray(x) ([x isKindOfClass:[NSMutableArray class]] && [x count]>0)


//UI
#define KeyWindow [UIApplication sharedApplication].delegate.window
#define kAppDelegate (AppDelegate *)[UIApplication sharedApplication].delegate

#define kWidth [[UIScreen mainScreen] bounds].size.width
#define kHeight [[UIScreen mainScreen] bounds].size.height
#define NavBarHeight 64
#define TabBarHeight 49
#define NavHFit          (IS_IPHONE_X ? 88 : 64)
#define BottomYFit       (IS_IPHONE_X ? 43 : 0)

//色值
#define RGBA(r,g,b,a) [UIColor colorWithRed:r/255.0f green:g/255.0f blue:b/255.0f alpha:a]
#define RGB(r,g,b) RGBA(r,g,b,1.0f)
#define HEXCOLOR(hex) [UIColor colorWithRed:((float)((hex & 0xFF0000) >> 16)) / 255.0 green:((float)((hex & 0xFF00) >> 8)) / 255.0 blue:((float)(hex & 0xFF)) / 255.0 alpha:1]
#define Theme_Color RGB(19, 153, 231)

#define Black_BG_Color [UIColor colorWithHex:@"#1A1B1D"alpha:1.0]

//image
#define ImageName(name) [UIImage imageNamed:name]


#endif /* Macros_h */
